﻿using Abp.Application.User;
using Abp.Domian.UserInfo;
using Abp.Dto.UserDTO;
using Abp.Models;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;

namespace Abp.Controllers
{
    public class LoginController : Controller
    {
        private readonly IUserAppService _userAppService;

        public LoginController(IUserAppService userAppService)
        {
            _userAppService = userAppService;
        }

        public async Task<UserDTO> CheckLogin(string userNo, string password)
        {
            var user = await _userAppService.Get(userNo, password);
            return user;
        }

        public IActionResult Index()
        {
            return View();
        }

        public IActionResult Privacy()
        {
            return View();
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }

    }
}
